<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>Document</title>
</head>
<script>
	function printmsg() {
		alert("文档正在打印");
	}
	function printmsgs() {
		alert("你现在要打印该文档！");
	}
	function load() {
		alert("页面已经载入！");
	}
	function goodbye() {
		alert("页面卸载");
	}
	function upperCase() {
		var x = document.getElementById("fname").value
		document.getElementById("fname").value = x.toUpperCase()
	}
	function setStyle(x) {
		document.getElementById(x).style.background = "yellow";
	}
	function showMsg() {
		alert("您选中了一些文本！");
	}
</script>

<body onload="load()">

	一些文本：<input type="text" value="请选中我！" onselect="showMsg()">

	First name:<input type="text" id="fname" onfocus="setStyle(this.id)"><br>
	Last name: <input type="text" id="lname" onfocus="setStyle(this.id)">
	<a href="http://www.baidu.com" target="_blank" data-age="1" data-sex="男">访问百度页面!</a>
	<title dir="ltr" lang="" data-index="10" data-index-color="red" onbeforeprint="printmsgs()"></title>
	<table border="4" width="200" data-index="10" data-index-color="red"></table>
	<th abbr="" colspan="" data-index="10" data-index-color="red"></th>
	<img src="" border="2" usemap="" data-index="10" data-index-color="red" />
	<audio autoplay="" controls="" data-index="10" data-index-color="red"></audio>
	<video autoplay="" loop="" data-index="1" data-index-color="black">播放器</video>
	<source src="" name="" data-index="10" data-index-color="red" />
	<input accept="" alt="" size="" data-index="10" data-index-color="red" name="fname" id="fname"
		onblur="upperCase()" />
	<textarea autofocus="" cols="" data-index="20" data-index-color="red">文本域</textarea><br />
	<button disabled="disabled" formaction="url" data-age="1" data-sex="男">按钮</button>
	<select data="" multiple="" data-index="10" data-index-color="red"></select>
	<optgroup label="" disabled="" data-index="10" data-index-color="red"></optgroup>
	<option disabled="" label="" data-index="10" data-index-color="red" onunload="goodbye()"></option>
	<form accept-charset="" action="" data-index="10" data-index-color="red"></form>




</body>

</html>